<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var age = prompt('你今年多少岁了？');
        var str =('你'+age+'岁了');
        console.log(typeof age);
        alert(str);
        var num = 10;
        console.log(num);
        var timer = null;
        console.log(timer);
    //1.把数字型转换为字符串型 变量.toString()
    var num  = 10;
    var str = num.toString();
    console.log(str);
    //2.String(变量)
    console.log(String(num));
    //1.parseInt(变量) 可以把字符型的转换为数字型的 得到的是整数
        console.log(parseInt('3.94'));
        console.log(parseInt('3.95px'));
        console.log(parseInt('sd2'));
    //2.parseFloat(变量) 可以把字符型的转换为数字型的 得到的是浮点数
        console.log(parseFloat('3'));
    //3.Number(变量)
        console.log(Number('122.34'))
    //4.算数运算 - * /
    console.log('12' - 0);
    console.log(Boolean(''))
    console.log(Boolean(0))
    console.log(Boolean(NaN))
    console.log(Boolean(null))
    console.log(Boolean(undefined))
    console.log(Boolean('112'))
    alert('www'+12+'ssss\n' + 'ddddd')
    </script>
</head>
<body>
    
</body>
</html>